<template>
    <div class="xxx">
        <div class="main-menu">
            <div class="main-list" v-for="(mainItem,mainIndex) in menuList" :key="mainIndex">
                <div class="main-title" :class="{active:mainItem.isActive === true}" @click="switchMainMenu(mainItem,mainIndex)">
                    <div class="icon" :style="{backgroundImage:'url(../' + mainItem.icon + ')'}"></div>
                    <div class="text">{{ mainItem.name }}</div>
                </div>
                <transition name="slide">
                    <div class="sub-menu" v-if="mainItem.children !== undefined && mainItem.isActive === true">
                        <div class="sub-list" v-for="(subItem,subIndex) in mainItem.children" :key="subIndex">
                            <div class="sub-title" :class="{active:subItem.isActive === true}" @click="switchSubMenu(mainItem,mainIndex,subItem,subIndex)">
                                <div class="small-tips"></div>
                                <div class="text">{{ subItem.name }}</div>
                            </div>
                        </div>
                    </div>
                </transition>
            </div>
        </div>
    </div>
</template>
